<?php
class Admin_PageController extends Me_Controller_Action
{
    public function init()
    {
		parent::init();
		$this->_Model = new Admin_Model_Page();
		$this->view->baseUrl = $this->_request->getBaseUrl();
    }
	
	public function loadPageAction()
	{
		//Lấy Page id
		$pageId = $this->_request->getParam('pageId');
		
		$pagePanelDb = new Admin_Model_PagePanel();
		$portletDb = new Admin_Model_Portlet();
		
		//Lấy danh sách các panel của page
		$pagePanels = $pagePanelDb->getByPageId($pageId)->toArray();
		
		foreach ($pagePanels as &$pp)
		{
			//Lấy danh sách các porlet của panel
			$pp['portlets'] = $portletDb->getPortletByPanelPage($pp['id']);
		}
		
		$this->view->panels = $pagePanels;
		$this->_helper->layout->disableLayout();
		//$this->_helper->viewRenderer->setNoRender(); 
	}
	
	public function addAction()
    {
	}
}
?>